﻿using System;

namespace InsuranceCompany.Core.Domain.Objects
{
    abstract public class Entity
	{
        private static int IDcounter = 0;

        protected String ErrorMessage;

        private int Id;

        public Entity()
        {
            this.ErrorMessage = null;
            this.Id = IDcounter;
            IDcounter++;
        }
        public Entity(Entity e)
        {
            this.ErrorMessage = e.ErrorMessage;
            this.Id = e.Id;
        }

        public int GetId() { return this.Id; }
        public String getErrorMessage() { return ErrorMessage; }
        protected void setErrorMessage(String error) { ErrorMessage = error; }
        protected void resetErrorMessage() { ErrorMessage = null; }
	}
}